﻿using System;

namespace 策略模式
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入商品价格！");
            double money = Convert.ToDouble(Console.ReadLine());

            Console.WriteLine("请选择折扣类型 1.无优惠 2.满500减100 3.全场8折");

            string operate = string.Empty;
            switch (Console.ReadLine())
            {
                case "1": operate = "无优惠"; break;
                case "2": operate = "满500减100"; break;
                case "3": operate = "全场8折"; break;
            }

            CashContext cs = new CashContext(operate);
            Console.WriteLine("优惠后价格为：" + cs.GetResult(money));
            Console.ReadKey();
        }
    }
}
